package com.bw.user.web;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

/**
 * @ClassName DemoController
 * @Author Hao_YunKai
 * @Date 2022/3/2 20:01
 */
@Controller
public class DemoController {

    @Autowired
    private HttpServletRequest request;

    @RequestMapping(value = {"/"})
    public String login() {
        return "login";
    }

    @RequestMapping("goSeckill")
    public String goSeckill() {
        return "seckill";
    }

    @GetMapping("/test")
    public String test() {
        HttpSession session = request.getSession();
        session.setAttribute("admin","Hao_Yunkai");
        return "test";
    }
}
